<html>

    <head>
        <title>iMehfile - Push</title>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <link rel="stylesheet" type="text/css" href="../styles/style_push.css" />
        <link rel="stylesheet" type="text/css" href="../styles/cadre_info.css" />
        <link href="../styles/main.css" rel="stylesheet" type="text/css" />
    </head>

    <body>
    
        <ul>
            <li><a class="first" href="../index.php">Accueil</a></li>
        </ul>

    <fieldset>
        <legend>Envoi de notification Push</legend>
        <form method="post" action="pushsender.php"> 
            <label for="typedepush">Type de Push :</label>
            <SELECT name="pushtype" size="1">
                <OPTION>News
                <OPTION>Programme
            </SELECT>
            <br>
            <label for="messagepush">Message Push :</label>
            <TEXTAREA name="pushmessage" rows=5 cols=40></TEXTAREA>
            <br> 
            <input type="submit" value="PUSH"> 
        </form>
    </fieldset>
        
    <?php
    
        include '../database.php';
            
        $con = mysql_connect($hostname,$username,$password) or die('Could not connect to database : ' . mysql_error());
    
        mysql_select_db($database);
        
        //echo "<br>Connected to database " . $database;
        
        $query = "SELECT * FROM $devicestable"; 
    
        $result = mysql_query($query) or die('Error executing query :<br>'.$query.'<br>'.mysql_error()); 
    
    ?>

        <fieldset>
            <legend>Appareils ayant autoris&eacute;s la notification Push</legend>
            <TABLE id="table-design"> 
                <thead> 
                    <TH>Nom</TH> 
                    <TH>Mod&egrave;le</TH> 
                    <TH>Version iOS</TH>
                    <TH>Version MZ</TH>
                    <TH>Installation</TH>
                    <TH>Derni&egrave;re relance</TH> 
                </thead>
                <tbody>
            
    <?php  
    
        while($data = mysql_fetch_assoc($result)) 
        {
            echo '<tr>';
            echo '<td>'.$data['devicename'].'</td>';
            echo '<td>'.$data['devicemodel'].'</td>';
            echo '<td>'.$data['deviceversion'].'</td>';
            echo '<td>'.$data['appversion'].'</td>';
            echo '<td>'.$data['created'].'</td>';
            echo '<td>'.$data['updated'].'</td>';
            echo '<tr>';
        }
            
    ?>
                </tbody>
            </TABLE>
        </fieldset>
        
    <?php 
    
        mysql_close($con);
    
    ?>
        <!--
        <div id="gauche">
            <div id="droite">
                <div id="haut">
                    <div></div>
                </div>
                <h2>Attention</h2>
                <p>
                Si votre appareil n'est pas pr&eacute;sent dans la liste, c'est que nous n'avez pas install&eacute; la derni&egrave;re version de l'application.
                Merci d'effectuer l'installation depuis le Drive pour b&eacute;n&eacute;ficier des notifications Push.
                </p>
            </div>
        </div>
        -->
    </body>
    
</html>

